Ext.namespace('Divo');
Ext.namespace('Divo.app');

Divo.app.SupplierReviewForm = Ext.extend(Divo.Base.EditForm, {
  fields : new Ext.util.MixedCollection(),
  dataRecordMeta : Ext.data.Record.create([{
        name : "_p_record_status",
        type : "string"
      }, {
        name : "id",
        type : "float"
      }, {
        name : "checkState",
        type : "string"
      }, {
        name : "checkNote",
        type : "string"
      }]),
  initComponent : function() {
    var me = this;
    var tn = 1;

    this.fields.add("_p_record_status", new Ext.form.Hidden({
              name : "_p_record_status"
            }));
    this.fields.add("id", new Ext.form.Hidden({
              name : "id",
              dataIndex : "id",
              insert_allowed : true,
              update_allowed : true
            }));
    this.fields.add("checkNote", new app.base.TextArea({
              name : "checkNote",
              dataIndex : "checkNote",
              fieldLabel : "审核原因",
              allowBlank : false,
              labelSeparator : ":*",
              tabIndex : tn++,
              width : 150,
              insert_allowed : true,
              update_allowed : true
            }));
    this.fields.add("checkStateG", new Ext.form.RadioGroup({
              name : "checkStateG",
              dataIndex : "checkStateG",
              fieldLabel : "动作名称",
              allowBlank : false,
              labelSeparator : ":*",
              tabIndex : tn++,
              width : 170,
              defaultType : 'radio',
              items : [{
                    checked : true,
                    fieldLabel : '',
                    boxLabel : '审核通过',
                    name : 'checkState',
                    inputValue : '1'
                  }, {
                    fieldLabel : '',
                    labelSeparator : '',
                    boxLabel : '审核驳回',
                    name : 'checkState',
                    inputValue : '2'
                  }],
              insert_allowed : true,
              update_allowed : true
            }));
    Ext.apply(this, {
          items : [this.fields.get("_p_record_status"), {
            layout : "form",
            columnWidth : 1,
            labelAlign : "right",
            labelWidth : 100,
            items : [this.fields.get("id"), this.fields.get("checkStateG"),
                this.fields.get("checkNote")]
          }],
          border : false,
          frame : true,
          firstFocusFieldName : "checkNote"
        });

    Divo.app.SupplierReviewForm.superclass.initComponent.apply(this, arguments);
  }

  ,
  onRender : function() {
    Divo.app.SupplierReviewForm.superclass.onRender.apply(this, arguments);
  },
  newDataRecord : function() {
    return new this.dataRecordMeta({
          _p_record_status : "insert",
          id : "",
          name : "",
          state : ""
        });
  }

});
Ext.reg("Divo.app.SupplierReviewForm", Divo.app.SupplierReviewForm);